package me.firstapp.service.shop;

import java.util.Date;
import java.util.List;
import java.util.Map;

import me.firstapp.common.utils.Page;
import me.firstapp.module.shop.Order;

public interface OrderService {

	/**
	 * 订单新增
	 * 
	 * @param memberId
	 * @param remark
	 * @param apiClientId
	 * @return
	 */
	Order addOrder(Long memberId, String remark, Long apiClientId);

	/**
	 * 通过订单号查询订单
	 * 
	 * @param orderNo
	 * @param itemsFlag
	 * @param apiClientId
	 * @return
	 */
	Order findOrderByOrderNo(String orderNo, boolean itemsFlag, Long apiClientId);

	/**
	 * 支付订单
	 * 
	 * @param memberId
	 * @param orderNo
	 * @param password
	 * @param apiClientId
	 * @return
	 */
	Order executePayOrder(Long memberId, String orderNo, String password, Long apiClientId);

	/**
	 * 取消订单
	 * 
	 * @param orderNo
	 * @param apiClientId
	 * @return
	 */
	Order executeCancelOrder(String orderNo, Long apiClientId);

	/**
	 * 完成订单
	 * 
	 * @param orderNo
	 * @param apiClientId
	 * @return
	 */
	Order executeCompleteOrder(String orderNo, Long apiClientId);

	/**
	 * 订单发货
	 * 
	 * @param orderNo
	 * @param expressName
	 * @param expressNo
	 * @param apiClientId
	 * @return
	 */
	Order executeDistributeOrder(String orderNo, String expressName, String expressNo, Long apiClientId);

	/**
	 * 分页查询订单
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param memberId
	 * @param status
	 * @param apiClientId
	 * @return
	 */
	Page<Order> findOrderPage(Integer pageNo, Integer pageSize, Long memberId, Integer status, Long apiClientId);

	/**
	 * 分页查询订单
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param searchParams
	 * @param sortParam
	 * @param sortType
	 * @param startTime
	 * @param endTime
	 * @param apiClientId
	 * @return
	 */
	Page<Order> findOrderPage(Integer pageNo, Integer pageSize, Map<String, Object> searchParams, String sortParam,
			String sortType, Date startTime, Date endTime, Long apiClientId);

	/**
	 * 查询订单列表
	 * 
	 * @param memberId
	 * @param status
	 * @param apiClientId
	 * @return
	 */
	List<Order> findOrders(Long memberId, Integer status, Long apiClientId);
}
